<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">
        <h:form>
            <h:panelGroup layout="block" styleClass="header-user"  rendered="#{pageControllerJSFBean.usuario != null}">
                <h:outputLabel  value="#{msg.lb_en_linea}" styleClass="texto-azul"/>
                <h:outputLabel styleClass="nombre-user">
                    #{pageControllerJSFBean.usuario}
                    <p:commandLink value="#{msg.lb_salir}" onclick="PF('confirmacionSalir').show()" styleClass="cerrar-sesion" />
                </h:outputLabel>
            </h:panelGroup>             
        </h:form>
        
        <p:confirmDialog id="cerrarSession" message="#{msg.msg_cerrar_sesion}"  
                             header="#{msg.lb_cerrar_sesion}" severity="alert" widgetVar="confirmacionSalir"
                             appendTo="@(body)">  

                <p:commandButton id="confirm" value="#{msg.btn_confirmar}" 
                                 oncomplete="top.location.reload(true)"
                                 actionListener="#{pageControllerJSFBean.cerrarSesion}"  />  
                <p:commandButton id="decline" value="#{msg.btn_cancelar}" onclick="PF('confirmacionSalir').hide()" type="button" />   

        </p:confirmDialog>
    </f:view>
</html>
